﻿<template>
    <div>
        <div>
            <!-- <form action="http://y39406f563.51vip.biz/" method="get"> -->
                <input type="text" v-model="username" placeholder="请输入你的名字" /><br />
                <input type="text" v-model="userPasswd" placeholder="请输入你的密码" /><br />
                <input type="submit" value="注册" @click="RegBtn">
            <!-- </form> -->
        </div>
    </div>
</template>

<script>
import axios from 'axios'
    export default {
        name: 'Reg',
        components: {},
        data() {
            return {
                username:'',
                userPasswd:''
            }
        },
        methods: {
            RegBtn(){
                axios.post(`localhost:8085/insertPerson/${this.username}/${this.userPasswd}`).then(
                    response=>{
                        console.log('请求成功',response.data)
                        this.$bus.$emit('sendLogin',this.response.data)
                    },
                    error=>{
                        console.log('请求失败',error.message)
                    }
                )
            }
        },
    }
</script>

<style>

</style>